import React, { useState } from 'react';
import { Tag, Button } from 'antd';

import Child from './funcComponent';

const Func = () => {

    const [count, setCount] = useState(0);
    const [show, setShow] = useState(0);

    const onClick = () => setShow(show => show + 1);
    return (
        <div>
            <Button type='primary' onClick={() => setCount(count => count + 1)}>
                点击按钮是否会更新FuncComponent组件
            </Button>
            <br /><br />
            <Tag color='geekblue'>更新的数字：{count}</Tag>
            <Child show={show} onClick={onClick} />
        </div>
    )
}

export default Func;